
     using SmartSoft.DAL;
 using System.Web.Services;
    using System;
    using System.Data;
    using System.Data.SqlClient;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
public class WSCompanyDataAccess : System.Web.Services.WebService
{
    private CompanyDataAccess objDataAccess = new CompanyDataAccess();
    public WSCompanyDataAccess()
    {
    }


    [WebMethod]
    public void CompanyRegister(int pi_English, string ps_Code, ref bool pb_Existed, ref bool pb_Checked, ref bool pb_ParentChecked, ref string ps_Ten_Dvcs, ref string ps_Dia_Chi, ref string ps_Ms_Thue, ref string ps_Tk_NH, ref string ps_Chu_Tk, ref string ps_Ten_NH, ref string ps_Ten_TP, ref DateTime pd_Ngay_Bd_Ht, ref DateTime pd_Ngay_Kt_Ht, ref string ps_Ma_Th)
    {
        objDataAccess.CompanyRegister(pi_English, ps_Code, ref pb_Existed, ref pb_Checked, ref pb_ParentChecked, ref ps_Ten_Dvcs, ref ps_Dia_Chi, ref ps_Ms_Thue, ref ps_Tk_NH, ref ps_Chu_Tk, ref ps_Ten_NH, ref ps_Ten_TP, ref pd_Ngay_Bd_Ht, ref pd_Ngay_Kt_Ht, ref ps_Ma_Th);
    }

    [WebMethod(MessageName = "0Params", Description = "", EnableSession = true)]
    public DataTable GetCompanies()
    {
        return objDataAccess.GetCompanies();
    }

    [WebMethod(MessageName = "1Params", Description = "", EnableSession = true)]
    public DataTable GetCompanies(string ps_Code)
    {
        return objDataAccess.GetCompanies(ps_Code);
    }
    
    [WebMethod]
    public DataTable GetCompaniesByUser(string userName)
    {
        return objDataAccess.GetCompaniesByUser(userName);
    }

    [WebMethod]
    public string GetSubsidiaries(string ps_UserName)
    {

        return objDataAccess.GetSubsidiaries(ps_UserName);
    }

    [WebMethod]
    public string GetSubsidiariesNew(string p_Ma_Dvcs)
    {

        return objDataAccess.GetSubsidiariesNew(p_Ma_Dvcs);
    }

    [WebMethod]
    public void SetCompany(DataTable tableRow)
    {

        objDataAccess.SetCompany(tableRow.Rows[0]);
    }

    [WebMethod]
    public void SetEndDate(string ps_Subsidiary, DateTime pd_EndDate)
    {

        objDataAccess.SetEndDate(ps_Subsidiary, pd_EndDate);
    }
}